package scjhgl;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Cprscjh extends Model<Cprscjh> {
	public static final Cprscjh dao=new Cprscjh();
	/**
	 * 根据计划确认下达时间和生产班组编号，获取当前申请计划
	 * @param date 计划确认下达时间
	 * @param scbzbh 生产班组编号
	 * @return
	 */
	public List<Cprscjh> getcpscjhList(String date,int scbzbh){
		//return Cprscjh.dao.find("select * from scjhgl_cprscjh where fp_status = 0 and scbzbh= '"+scbzbh+"' and jhqrxdsj like '"+date+"_%'");
		//return Cprscjh.dao.find("select * from scjhgl_cprscjh where scbzbh= '"+scbzbh+"'");
		return Cprscjh.dao.find("select * from scjhgl_cprscjh where jhxdzt > 0 and fp_status = 0 and scbzbh= '"+scbzbh+"' and rscjhbh = '"+date+"'");
	}
	
	public Cprscjh getcprscjh(String ddh){
		return Cprscjh.dao.findFirst("select * from scjhgl_cprscjh where scddh =?",ddh);
	}

}
